<!--产品推荐-->
<template>
  <div class="specialOffer">
    <div>
      <h3>
        <p>
          <span class="icon iconfont" :class="iconchanges"></span>
          <i>{{title}}</i>
        </p>
        <!-- <router-link
          :to="{name:'preferentialMarket'}"
          style="
            color:#fff;font-size: 12px;
            font-weight: normal;
            padding-right: 5px;
          "
        >查看更多 >></router-link>-->
      </h3>

      <div>
        <div class="content">
          <div class="contentLeft">
            <div class="leftkkk" @click="jumpDetails(data[0].id,data[0].pid,data[0])">
              <div class="contentLeftImage">
                <img :src="data[0].image ? data[0].image : defaultNoImage" >
              </div>
              <div class="contentLeftText">
                <h5>{{data[0].name}}</h5>
                <p>{{data[0].describe}}</p>
                <p>{{data[0].time}}</p>
                <p>
                  <span>￥{{data[0].price}}</span>
                  <del>￥{{data[0].old_price}}</del>
                </p>
                <p>查看详情</p>
              </div>
            </div>
          </div>

          <div class="contentRight">
            <div>
              <div class="contentRightTop" @click="jumpDetails(data[1].id,data[1].pid,data[1])">
                <img :src="data[1].image ? data[1].image : defaultNoImage" >
                <div>
                  <h5>{{data[1].name}}</h5>
                  <p>{{data[1].describe}}</p>
                  <p>
                    <span>￥{{data[1].price}}</span>
                    <del>￥{{data[1].old_price}}</del>
                  </p>
                </div>
              </div>
              <div class="contentRightBottom" @click="jumpDetails(data[2].id,data[2].pid,data[2])">
                <img :src="data[2].image ? data[2].image : defaultNoImage" >
                <div>
                  <h5>{{data[2].name}}</h5>
                  <p>{{data[2].describe}}</p>
                  <p>
                    <span>￥{{data[2].price}}</span>
                    <del>￥{{data[2].old_price}}</del>
                  </p>
                </div>
              </div>
            </div>
          </div>
        </div>

        <div class="content">
          <div class="contentLeft">
            <div class="leftkkk" @click="jumpDetails(data[3].id,data[3].pid,data[3])">
              <div class="contentLeftImage">
                <img :src="data[3].image ? data[3].image : defaultNoImage" >
              </div>
              <div class="contentLeftText">
                <h5>{{data[3].name}}</h5>
                <p>{{data[3].describe}}</p>
                <p>{{data[3].time}}</p>
                <p>
                  <span>￥{{data[3].price}}</span>
                  <del>￥{{data[3].old_price}}</del>
                </p>
                <p>查看详情</p>
              </div>
            </div>
          </div>

          <div class="contentRight">
            <div>
              <div class="contentRightTop" @click="jumpDetails(data[4].id,data[4].pid,data[4])">

                <img :src="data[4].image ? data[4].image : defaultNoImage" >
                <div>
                  <h5>{{data[4].name}}</h5>
                  <p>{{data[4].describe}}</p>
                  <p>
                    <span>￥{{data[4].price}}</span>
                    <del>￥{{data[4].old_price}}</del>
                  </p>
                </div>
              </div>
              <div class="contentRightBottom" @click="jumpDetails(data[5].id,data[5].pid,data[5])">
                <img :src="data[5].image ? data[5].image : defaultNoImage" >
                <div>
                  <h5>{{data[5].name}}</h5>
                  <p>{{data[5].describe}}</p>
                  <p>
                    <span>￥{{data[5].price}}</span>
                    <del>￥{{data[5].old_price}}</del>
                  </p>
                </div>
              </div>
            </div>
          </div>
        </div>
      </div>
    </div>
  </div>
</template>
<script>
import goods from "../../../assets/images/goods1.png"
export default {
  name: "SpecialOffer",
  props: {
    data: Array
  },
  data() {
    return {
      defaultNoImage: require('../../../assets/logo/loading.png'),
      title: "产品推荐",
      iconchanges: "icon-chilun"// 设置图标  后期会更换
    }
  },

  methods: {
    jumpDetails(id, pid, item) {
      let temp = item
      temp.goods_title = item.name
      this.$router.push({
        name: "productDetails",
        params: {
          id,
          pid,
          item:temp
        }
      })
    }
  }

}
</script>
<style lang="scss" scoped>
.specialOffer {
  width: 100%;
  background: #f1f1f1;
  padding-bottom: 18px;
  div {
    width: 1200px;
    margin: auto;
    h3 {
      line-height: 40px;
      padding: 0 10px;
      font-size: 16px;
      color: #ffffff;
      display: flex;
      flex-direction: row;
      justify-content: space-between;
      background: linear-gradient(
        to right,
        #007ee6,
        #392ba7
      ); /* 标准的语法（必须放在最后） */
      p {
        &:last-child {
          cursor: pointer;
        }
        .more {
          font-weight: normal;
          font-size: 12px;
        }
      }
    }
    div {
      display: flex;
      flex-direction: row;
      justify-content: space-between;
      .content {
        margin: 0;
        width: 598px;
        height: 210px;
        display: flex;
        flex-direction: row;
        justify-content: space-between;
        .contentLeft {
          background-color: #fff;

          .leftkkk {
            width: 312px;
            height: 210px;
            display: flex;
            flex-direction: row;
            justify-content: space-between;
            .contentLeftImage {
              margin: 10 10px;
              width: 140px;
              height: 140px;
              cursor: pointer;
              img {
                width: 100%;
                height: 100%;
                margin-left: 3px;
                transition: 0.3s all ease-out;
                &:hover {
                  opacity: 0.8;
                }
              }
            }
            .contentLeftText {
              width: 172px;
              height: 210px;
              display: flex;
              flex-direction: column;
              text-align: center;
              justify-content: flex-start;
              h5 {
                width: 174px;
                min-height: 70px;
                box-sizing: border-box;
                padding: 10px 10px;
                font-weight: normal;
                font-size: 16px;
                margin-top: 32px;
                overflow: hidden;
                white-space: nowrap;
                text-overflow: ellipsis;
                color: #333;
              }
              p:first-child {
                font-size: 16px;
                overflow: hidden;
                white-space: nowrap;
                text-overflow: ellipsis;
              }
              p:nth-child(3) {
                color: #6a6a6a;
                line-height: 46px;
                font-size: 14px;
              }
              p:nth-child(4) {
                display: flex;
                flex-direction: row;
                justify-content: space-around;
                align-items: center;
                line-height: 28px;
                span {
                  color: #fe2121;
                  font-size: 18px;
                  font-weight: 700;
                }
                del {
                  color: #a3a3a3;
                  font-size: 14px;
                }
              }
              p:nth-child(5) {
                width: 76px;
                height: 24px;
                margin-left: 48px;
                border-radius: 5px;
                background: #000;
                color: #fff;
                line-height: 24px;
                text-align: center;
                margin-top: 10px;
                cursor: pointer;
                &:hover {
                  color: #eeebeb;
                }
              }
            }
          }
        }
        .contentRight {
          div {
            box-sizing: border-box;
            margin-left: 3px;
            width: 280px;
            height: 210px;
            display: flex;
            flex-direction: column;
            justify-content: space-between;
            .contentRightTop,
            .contentRightBottom {
              // &:hover img {
              //   opacity: 0.8;
              // }
              cursor: pointer;
              background: #fff;
              width: 280px;
              height: 102px;
              display: flex;
              flex-direction: row;
              justify-content: space-between;
              img {
                width: 102px;
                height: 102px;
                // margin-left: 1px;
                transition: 0.3s all ease-out;
                &:hover {
                  opacity: 0.8;
                }
              }
              div {
                width: 100%;
                height: 102px;
                justify-content: flex-start;
                text-align: center;
                box-sizing: border-box;
                h5 {
                  box-sizing: border-box;
                  padding: 20px 10px;
                  width: 175px;
                  font-size: 14px;
                  font-weight: normal;
                  color: #333;
                  overflow: hidden;
                  white-space: nowrap;
                  text-overflow: ellipsis;
                }
                p:nth-child(2) {
                  font-size: 14px;
                }
                p:nth-child(3) {
                  display: flex;
                  flex-direction: row;
                  justify-content: space-around;
                  align-items: center;
                  line-height: 28px;
                  span {
                    color: #fe2121;
                    font-size: 18px;
                  }
                  del {
                    color: #a3a3a3;
                    font-size: 14px;
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}
</style>
